﻿using System;
using System.Collections.Generic;
using System.Text;
using Boomerang.Common.Crm;
using Boomerang.Common.Sms;
using System.Globalization;

namespace Boomerang.Common.Configuration
{
    [Serializable()]
    public class Organization
    {
        public Organization()
        {
            this.CrmConnectionOptions = new CrmConnectionOptions();
            this.SmsConnectionOptions = new SmsConnectionOptions();
            this.OrganizationId = Guid.NewGuid();
        }

        //public string Name { get { return CrmConnectionOptions.OrgName; } }

        public CrmConnectionOptions CrmConnectionOptions { get; set; }

        public SmsConnectionOptions SmsConnectionOptions { get; set; }

        public Guid OrganizationId { get; set; }

        public string Key { get { return OrganizationId.ToString(); } }

        public override string ToString()
        {
            return string.Format(CultureInfo.InvariantCulture, "{0} at {1} | Boomerang User: {2}", CrmConnectionOptions.OrgName, CrmConnectionOptions.DiscoveryServerUrl, SmsConnectionOptions.BoomerangUserName);
        }
    }
}
